package org.spring.boot.jpa.jpa;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.transaction.Transactional;

@SpringBootApplication
@RestController
public class JpaApplication {

    public static void main(String[] args) {
        SpringApplication.run(JpaApplication.class, args);
    }

    @Autowired
    private JpaMember mJpaMember;

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public Object sa(){
        return mJpaMember.findAll();
    }
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    @Transactional
    public void delete(){
         mJpaMember.mydelete("测试",1536665727928L);
    }
    @RequestMapping(value = "/select",method = RequestMethod.GET)
    public Object select(){
        return mJpaMember.myselect(1536665727928L);
    }

}
